from pydantic import BaseModel, Field
from typing_extensions import TypedDict
from typing import Optional, List, Literal, Sequence
class SetCookieParam(TypedDict, total=False):
    name: str
    value: str
    url: Optional[str]
    domain: Optional[str]
    path: Optional[str]
    expires: Optional[float]
    httpOnly: Optional[bool]
    secure: Optional[bool]
    sameSite: Optional[Literal["Lax", "None", "Strict"]]
class CookieConfig(BaseModel):
    domain: str = Field(default=None)
    cookies: Optional[Sequence[SetCookieParam]] = None
    local_storage: Optional[str] = None

class ProxyConfig(BaseModel):
    proxys: Optional[Sequence[str]] = None


class SearchResult(BaseModel):
    title: Optional[str] = Field(default=None)
    url: Optional[str] = Field(default=None)
    description: Optional[str] = Field(default=None)
    icon: Optional[str] = Field(default=None)
    score: Optional[float] = Field(default=0.0)

class TaskException(Exception):
    pass